<template>
  <div class="outer">
    <Tab title="美食">
      <!-- 使用组件的时候,可以传递插槽,使用v-slot指令向指定的插槽插入内容:v-slot:center
        v-slot指令只能使用在组件或者<template>上
        v-slot:center可以简写为#center -->
      <template #content>
        <img
          width="200"
          src="https://img2.baidu.com/it/u=2082735800,426564252&fm=253&fmt=auto&app=138&f=GIF?w=400&h=300"
          alt=""
        />
      </template>
      <template #footer>
        <span>火锅</span>
        <span>好7</span>
      </template>
    </Tab>

    <Tab title="游戏">
      <template #content>
        <ul>
          <li>LoL</li>
          <li>CF</li>
          <li>DNF</li>
        </ul>
      </template>

      <template #footer>
        <a href="###">点我玩游戏</a>
        <a href="###">点我饥饿游戏</a>
      </template>
    </Tab>

    <Tab title="电影">
      <template #content>
        <video src="" width="200" autoplay muted></video>
      </template>
    </Tab>
  </div>
</template>

<script>
import { v4 as uuidv4 } from "uuid";
import Tab from "./components/Tab.vue";
export default {
  name: "App",
  components: {
    Tab,
  },
  data() {
    return {
      tabData: [
        { id: uuidv4(), title: "美食", list: ["火锅", "烧烤", "小龙虾"] },
        { id: uuidv4(), title: "游戏", list: ["LoL", "DNF", "CS", "Dota"] },
        {
          id: uuidv4(),
          title: "电影",
          list: ["独行月球", "智取威虎山", "绿皮书"],
        },
      ],
    };
  },
};
</script>

<style scoped>
.outer {
  width: 800px;
  display: flex;
  justify-content: space-between;
}
</style>